<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #d1{
      width: 100px;
      height: 100px;
      background-color: red;
    }
  </style>
  <script>
    window.onload=function(){
      // 获取元素
      var div=document.getElementById('d1');
      // 鼠标双击 dblclick
      div.ondblclick=function(){
        console.log('我被双击了');
      }
      // 鼠标移入事件
      div.onmouseenter=function(){
        console.log('我移入到了div');
      }
      // 鼠标移出事件
      div.onmouseleave=function(){
        console.log('我移出到了div');
      }
      // 鼠标移动事件
      div.onmousemove=function(){
        console.log('我在div中移动');
      }
    }
  </script>
</head>
<body>
  <div id="d1">我是div</div>
</body>
</html>